<?php

namespace app\common\model\server;

use app\common\contract\Account;
use app\common\contract\Curd;
use app\common\contract\Power;

class AdminModel implements Curd, Account, Power
{
    public function __construct()
    {
        $this->logic = model('logic.admin');
    }

    //获取列表方法
    public function getListPage($data)
    {
        return $this->logic->getListPage($data);
    }

    //保存添加
    public function saveAdd($data)
    {
        return $this->logic->saveAdd($data);
    }

    //获取某一行信息
    public function getRow($data)
    {
        return $this->logic->getRow($data);
    }

    //根据条件获取单行
    public function getLine($where)
    {
        return $this->logic->getLine($data);
    }

    //保存编辑
    public function saveEdit($data)
    {
        return $this->logic->saveEdit($data);
    }

    //保存删除
    public function saveDel($data)
    {
        return $this->logic->saveDel($data);
    }

    //登录方法
    public function login($data)
    {
        return $this->logic->login($data);
    }

    //退出登录
    public function logout($data)
    {
    }

    //获取账号信息
    public function getInfo()
    {
        return $this->logic->getInfo();
    }

    //保存账号信息
    public function saveInfo($data)
    {
        return $this->logic->saveInfo($data);
    }

    //设置登录密码
    public function setPassword($data)
    {
        return $this->logic->setPassword($data);
    }

    public function checkToken()
    {
        return $this->logic->checkToken();
    }

    //获取权限
    public function getPower($data)
    {
        return  $this->logic->getPower($data);
    }

    //保存权限
    public function savePower($data)
    {
        return  $this->logic->savePower($data);
    }
}
